package com.ton.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@RestController
@RequestMapping("/jr/bs")
public class BsTestController {

    @GetMapping("login")
    public ModelAndView login() {
        return new ModelAndView("/login");

    }

    @PostMapping("sayHi")
    public ModelAndView sayHi(String name) {
        ModelAndView modelAndView = new ModelAndView("/sayHi");
        modelAndView.addObject("name", name);
        return modelAndView;
    }
}
